<?php
/**
 * Created by JetBrains PhpStorm.
 * User: CAIXUDONG
 * Date: 11-6-15
 * Time: 下午3:59
 */
include 'bootstrap.php';

//控制器名称
$file_name = basename(__FILE__,'.php');
$controller = $_input->get('m',$file_name);
//动作名称
$action = $_input->get('a','index');

if(!in_array($action,array('login'))){
    $user_info = Model::getInstance('user')->needLogin();
    $_m = $controller == $file_name ? '' : '?m='.$controller;
    $_a = $action == 'index'  ? '' : ($_m == '' ? '?' : '&') .'a='.$action;
    $action_name = strtolower(trim($file_name . '.php' . $_m . $_a));
    $is_action = Model::getInstance('user')->isAction($action_name);
}
Controller::getInstance($controller)->{$action}();